#ifndef VALIDATOR_H
#define VALIDATOR_H

#include <QList>
#include <QString>
#include <QDomNode>
#include <QDomDocument>


class Validator
{
public:
	static Validator* instance();

	QString check( QDomDocument& xmlDocument );

	bool isPrimitiveType( QString& type )
	{
		return m_primitiveTypes.contains( type );
	}

	bool isCompositeType( QString& type )
	{
		return m_compositeTypes.contains( type );
	}

private:
	Validator();

	~Validator()
	{
		//DOES NOTHING
	}

	void subscribeClasses( QDomNode firstClassNode );

	QString checkBlackBearNodeMapping( QDomDocument& xmlDocument );

	QString checkName( QString& name );
	QString checkClassName( QString& className );
	QString checkAttributeName( QString& className );

	QString checkType( QString& type );
	QString checkClassExtension( QString& classType );
	QString checkAttributeType( QString& attributeType );

	static Validator* m_instance;

	QList<QString> m_primitiveTypes;
	QList<QString> m_compositeTypes;
};

#endif